//
//  InfoWebViewController.m
//  UGuideUS
//
//  Created by Will Wang on 23/07/2012.
//  Copyright (c) 2012 UGuideUs. All rights reserved.
//

#import "InfoWebViewController.h"

@interface InfoWebViewController ()

@end

@implementation InfoWebViewController
@synthesize webView;
@synthesize linkInfo=_linkInfo;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:172.0/255   
                                                                        green:04.0/255   
                                                                         blue:08.0/255   
                                                                        alpha:1];
    

//    NSLog(@"link is %@",_linkInfo);
    NSString *webLink;
    if([_linkInfo isEqualToString:@"Google"]){
        webLink=@"http://code.google.com/p/u-guide-us/";
    }else if([_linkInfo isEqualToString:@"Youtube"]){
        webLink=@"https://www.youtube.com/watch?v=yPG17jkdmAc";
        
    }
    
    //Create a URL object.
    NSURL *url = [NSURL URLWithString:webLink];
    //URL Requst Object
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    
    [webView loadRequest:requestObj];
    
}

- (void)viewDidUnload
{
    [self setWebView:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
